#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%
; mouse control



Mouse_Move(x, y) {
    ; MouseMove, x, y
    DllCall("SetCursorPos", int, x, int, y)  ; relative to the screen
}



Mouse_Center(key:="") {
    ; move mouse to center of windows
    WinGetPos, x, y, w, h, A

    If(key != "") {
        KeyWait, %key%
    }

    Mouse_Move(x + w/2, y + h/2)
}



Mouse_Taskbar() {
    ; when mouse on taskbar return true
    MouseGetPos,,, Win
    Return WinExist("ahk_class Shell_TrayWnd" . " ahk_id " . Win)
}
